/*组成最大数*/
#include <stdio.h>

void bubble_sort( int all[] , int length)
{
	int i,j,process;
	for ( i=0 ; i<length-1 ; i++)
	{
		for ( j=0 ; j<length-1-i ; j++)
		{
			if ( all[j] <= all[j+1] )
			{
				process = all[j+1];
				all[j+1] = all[j];
				all[j] = process;
			}
		}
	}
 } 
 
int main()
{
	int n,all[10],length,k;
	scanf("%d",&n);
	for ( k=0 ; n>0&&k<10 ; k++)
	{
		all[k] = n%10;
		n=n/10;
	}
	length = k;
	bubble_sort( all , length);
	for ( int i=0 ; i<length ; i++)
	{
			printf("%d",all[i]);
	}
	printf("\n"); 
	return 0;
 } 
